const path = require("path");
const webpack = require('webpack');
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = {
	entry: "./src/index.js",
	output: {
		filename: "main.js",
		path: path.resolve(__dirname, "dist"),
	},
	plugins: [
		new HtmlWebpackPlugin({ template: "./public/index.html" }),
		new webpack.ProvidePlugin({
			PIXI: 'pixi.js'
		}),
		new CopyWebpackPlugin([{
			from: __dirname + '/public',
			to: __dirname + '/dist/public',
			ignore: ['index.html']
		}])
	],
	devServer: {
		contentBase: path.join(__dirname, 'dist'),
		compress: true,
		port: 8101
	}
};
